package com.example.musicdemo.widget

import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.RelativeLayout
import com.example.musicdemo.R
import com.example.musicdemo.model.Music
import kotlinx.android.synthetic.main.item_pop.view.*

class PopListItemView : RelativeLayout {
    constructor(context: Context) : super(context)
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    )
    init {
        View.inflate(context, R.layout.item_pop,this)
    }

    fun setData(data: Music){
        //title
        tvTitle.text = data.name
        //artist
        tvArtist.text = data.getSinger()
    }




}